import { Component, ViewChild } from '@angular/core';
import { NavController, NavParams, Nav } from 'ionic-angular';
import { ParkListPage } from '../park-list/park-list';
import { AboutPage } from '../about/about';

/**
 * Generated class for the ParkSidemenuPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@Component({
  selector: 'page-park-sidemenu',
  templateUrl: 'park-sidemenu.html',
})
export class ParkSidemenuPage {

  
  @ViewChild(Nav) nav: Nav;

  rootPage: any = ParkListPage;

  pages: Array<{title: string, component: any}>;

  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    this.pages=[
      {title:'景区',component:ParkListPage},
      {title:'关于',component:AboutPage}
    ];
  }
  openPage(page) {
    // Reset the content nav to have just this page
    // we wouldn't want the back button to show in this scenario
    this.nav.setRoot(page.component);
  }
}
